//
//  SecondViewControllerOfFirstTabBar.m
//  UI09_UITabBarController
//
//  Created by wyx on 16/3/21.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "SecondViewControllerOfFirstTabBar.h"

@interface SecondViewControllerOfFirstTabBar ()

@end

@implementation SecondViewControllerOfFirstTabBar

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createButtonToSecondBarItem];
}
- (void)createButtonToSecondBarItem{
    UIButton *buttonToSecondBar = [UIButton buttonWithType:UIButtonTypeSystem];
    buttonToSecondBar.frame = CGRectMake(100, 100, 50, 50);
    buttonToSecondBar.backgroundColor = [UIColor yellowColor];
    [buttonToSecondBar setTitle:@"第二个" forState:UIControlStateNormal];
    [self.view addSubview:buttonToSecondBar];
    [buttonToSecondBar addTarget:self action:@selector(handleOfToSecondBar:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)handleOfToSecondBar:(UIButton *)secondBar{
    self.tabBarController.selectedIndex = 1;
    //这页消失
    [self.navigationController popViewControllerAnimated:NO];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
